package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementOspfv2PortMapper;
import com.ruoyi.net.domain.ElementOspfv2Port;
import com.ruoyi.net.service.IElementOspfv2PortService;

/**
 * 网元-OSPFV2接口配置Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementOspfv2PortServiceImpl implements IElementOspfv2PortService 
{
    @Autowired
    private ElementOspfv2PortMapper elementOspfv2PortMapper;

    /**
     * 查询网元-OSPFV2接口配置
     * 
     * @param id 网元-OSPFV2接口配置主键
     * @return 网元-OSPFV2接口配置
     */
    @Override
    public ElementOspfv2Port selectElementOspfv2PortById(String id)
    {
        return elementOspfv2PortMapper.selectElementOspfv2PortById(id);
    }

    /**
     * 查询网元-OSPFV2接口配置列表
     * 
     * @param elementOspfv2Port 网元-OSPFV2接口配置
     * @return 网元-OSPFV2接口配置
     */
    @Override
    public List<ElementOspfv2Port> selectElementOspfv2PortList(ElementOspfv2Port elementOspfv2Port)
    {
        return elementOspfv2PortMapper.selectElementOspfv2PortList(elementOspfv2Port);
    }

    /**
     * 新增网元-OSPFV2接口配置
     * 
     * @param elementOspfv2Port 网元-OSPFV2接口配置
     * @return 结果
     */
    @Override
    public int insertElementOspfv2Port(ElementOspfv2Port elementOspfv2Port)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementOspfv2Port.getId())) {
            elementOspfv2Port.setId(uuid);
        }
        elementOspfv2Port.setCreateBy(SecurityUtils.getUsername());
        elementOspfv2Port.setCreateTime(DateUtils.getNowDate());
        elementOspfv2Port.setUpdateBy(SecurityUtils.getUsername());
        elementOspfv2Port.setUpdateTime(DateUtils.getNowDate());
        return elementOspfv2PortMapper.insertElementOspfv2Port(elementOspfv2Port);
    }

    /**
     * 修改网元-OSPFV2接口配置
     * 
     * @param elementOspfv2Port 网元-OSPFV2接口配置
     * @return 结果
     */
    @Override
    public int updateElementOspfv2Port(ElementOspfv2Port elementOspfv2Port)
    {
        elementOspfv2Port.setUpdateBy(SecurityUtils.getUsername());
        elementOspfv2Port.setUpdateTime(DateUtils.getNowDate());
        return elementOspfv2PortMapper.updateElementOspfv2Port(elementOspfv2Port);
    }

    /**
     * 批量删除网元-OSPFV2接口配置
     * 
     * @param ids 需要删除的网元-OSPFV2接口配置主键
     * @return 结果
     */
    @Override
    public int deleteElementOspfv2PortByIds(String[] ids)
    {
        return elementOspfv2PortMapper.deleteElementOspfv2PortByIds(ids);
    }

    /**
     * 删除网元-OSPFV2接口配置信息
     * 
     * @param id 网元-OSPFV2接口配置主键
     * @return 结果
     */
    @Override
    public int deleteElementOspfv2PortById(String id)
    {
        return elementOspfv2PortMapper.deleteElementOspfv2PortById(id);
    }
}
